package cn.pengpeng.rpc.inter;

import java.io.IOException;

import org.apache.hadoop.HadoopIllegalArgumentException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.ipc.RPC.Builder;
import org.apache.hadoop.ipc.RPC.Server;

public class RPCServer {
	public static void main(String[] args) throws HadoopIllegalArgumentException, IOException {
		Builder builder = new RPC.Builder(new Configuration());
		builder.setBindAddress("localhost")
		.setPort(8888)
		.setProtocol(Service.class)
		.setInstance(new ServiceImpl());
		
		Server server = builder.build();
		server.start();
		
	}

}
